home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI1190.ASC
< prev
next >
Wrap
Text File
|
1992-11-12
|
5KB
|
199 lines
PRODUCT : Paradox NUMBER : 1190
VERSION : All
OS : DOS
DATE : November 12, 1992 PAGE : 1/3
TITLE : Creating a crosstab with non-numeric data
In order to create a Crosstab table, Paradox needs numerical data
to summarize. Some tables might not have numeric fields to work
with, so it is necessary to create a numeric field in order to
produce a Crosstab table. The table below called "Customer" is a
list of customers, products that they have purchased, and what
form of advertising brought them to the store to purchase that
product. The table "Customer" is in normalized form - the values
TV ad, Radio ad, and Friend are values in one field (Referred by)
rather than separate fields themselves (which would be a non-
normalized form). For information on table normalization refer
to TI 124 and TI 127.
Customer═╦══Name══╦═Product═╦═Referred by═╗
║ Dave ║ VCR ║ TV ad ║
║ Dave ║ TV ║ TV ad ║
║ John ║ TV ║ Radio ad ║
║ Kevin ║ Camera ║ Radio ad ║
║ Nadine ║ VCR ║ Friend ║
║ Cindy ║ VCR ║ Friend ║
║ Norm ║ TV ║ TV ad ║
║ Mike ║ VCR ║ TV ad ║
║ Cal ║ TV ║ Radio ad ║
║ Aileen ║ VCR ║ TV ad ║
║ Dan ║ Camera ║ Friend ║
From the table above, suppose we want to create a Crosstab which
has all of the different "Product" values as its rows, all of the
different "Referred by" values as its columns, and the count of
how many times a product was referred by each advertising
category.
PRODUCT : Paradox NUMBER : 1190
VERSION : All
OS : DOS
DATE : November 12, 1992 PAGE : 2/3
TITLE : Creating a crosstab with non-numeric data
Part I: Create a numeric field to summarize crosstab data.
Create a numeric field to summarize crosstab data by performing
the following query.
Customer═╦══Name══╦═Product═╦════Referred by════╗
║ ║√+ ║√+calc 1 as Dummy ║
║ ║ ║ ║
The "√+" is produced by pressing <Alt-F6>. This query creates
the following Answer table:
Answer═╦═Product═╦═Referred by═╦═Dummy═╗
║ VCR ║ TV ad ║ 1 ║
║ TV ║ TV ad ║ 1 ║
║ TV ║ Radio ad ║ 1 ║
║ Camera ║ Radio ad ║ 1 ║
║ VCR ║ Friend ║ 1 ║
║ VCR ║ Friend ║ 1 ║
║ TV ║ TV ad ║ 1 ║
║ VCR ║ TV ad ║ 1 ║
║ TV ║ Radio ad ║ 1 ║
║ VCR ║ TV ad ║ 1 ║
║ Camera ║ Friend ║ 1 ║
Part II: Crosstab the Answer table
To produce the Crosstab:
1. Select <F10> | Image | Graph | Crosstab | Count.
2. Move to the column that contains the row values (i.e. the
Product field), then press <Enter>.
3. Move to the column that contains the column labels (i.e.
the Referred by field), then press <Enter>.
PRODUCT : Paradox NUMBER : 1190
VERSION : All
OS : DOS
DATE : November 12, 1992 PAGE : 3/3
TITLE : Creating a crosstab with non-numeric data
4. Move to the field that contains the numerical data (i.e.
the Dummy field), then press <Enter>.
The following Crosstab table is created:
Crosstab═╦═Product═╦═TV ad═╦═Radio ad═╦═Friend═╗
║ Camera ║ 0 ║ 1 ║ 1 ║
║ TV ║ 2 ║ 2 ║ 0 ║
║ VCR ║ 3 ║ 0 ║ 2 ║
Part III: (Optional) Reversing the row and column labels
To have the row and column labels reversed, perform the steps
below:
1. After performing the query in Part I on page 2 of this
Technical Information sheet, move the cursor to the
Product field and press <Ctrl-R> to rotate the fields.
2. Rotate the fields one more time by moving to the Dummy
field and pressing <Ctrl-R>.
3. Now the two fields Product and Referred by are reversed
and you can proceed with crosstabbing the Answer table
(follow the steps in outlined Part II on page 2 of this
Technical Information sheet).
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.